package com.taijihuabao.modules.mapper;

import com.taijihuabao.modules.entity.ApprovalEntity;
import com.taijihuabao.modules.entity.ExpenseEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author luoxianan
 */
@Mapper
public interface ExpenseMapper {

    /**
     * 根据报销单修改
     * @param expenseEntity
     */
    void updateExpense(ExpenseEntity expenseEntity);

    /**
     * 新增报销审批单
     * @param expenseEntity
     */
    void insertExpense(ExpenseEntity expenseEntity);

    /**
     * 根据报销单号查询审批单
     * @param expenseEntity
     * @return
     */
    ExpenseEntity selectByExpenseId(ExpenseEntity expenseEntity);

    /**
     * 根据审批编码查询审批单
     * @param expenseEntity
     * @return
     */
    ExpenseEntity selectByExpenseCode(ExpenseEntity expenseEntity);

    /**
     * 根据审批人id查询审批单
     * @param expenseEntity
     * @return
     */
    List<ExpenseEntity> selectByExpenseUserId(ExpenseEntity expenseEntity);

    /**
     *  根据申请人id查询审批单
     * @param expenseEntity
     * @return
     */
    List<ExpenseEntity> selectByApplyUserId(ExpenseEntity expenseEntity);

    /**
     * 根据id查询审批单
     * @param id
     * @return
     */
    ExpenseEntity selectById(Long id);

    /**
     * 根据任务号查询
     * @param
     * @return
     */
    ExpenseEntity selectByTask(String task);

    /**
     * 查询审批单
     * @param applyDeptCode
     * @param expenseId
     * @return
     */
    List<ExpenseEntity> selectByExpense(@Param("applyDeptCode") String applyDeptCode,@Param("expenseId") String expenseId);
}
